package likou;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author: Tangxz
 * @email: 1171702529@qq.com
 * @cate: 2021/10/20 09:21
 */
public class _453 {
    public static void main(String[] args) {

        List<ArrayList<Integer>> lists = new ArrayList<>();
        List<Integer> l = new ArrayList<>();
        _453 one = new _453();
        System.out.println(one.minMoves(new int[]{1, 1, 1}));
    }
    public int minMoves(int[] nums) {
        int max = Arrays.stream(nums).max().getAsInt();
        int sum = Arrays.stream(nums).sum();
        int i=0;
        while (true){
            if (sum%nums.length==0&&max<=sum/nums.length){
                return i;
            }
            i++;
            sum+=(nums.length-1);
        }
    }
}
